JBoss Community Archive (Read Only)

Arquillian Old

Jetty 7.0 - Embedded

A DeployableContainer implementation that can run and connect to a embedded (same JVM) Jetty 7 Servlet Container. Only select EE APIs are available, such as JNDI and parts of Servlet (support for web-fragement.xml is the important bit). This implementation has lifecycle support, so the container will be started and stopped as part of the test run.

Container Injection Support Matrix

@Resource

@EJB

@EJB (no-interface)

@Inject (CDI)

@Inject (MC)

@PersistenceContext @PersistenceUnit

images/author/download/attachments/23822413/fact_good.png

 

 

images/author/download/attachments/23822413/fact_good.png

 

 

CDI support requires use of Weld Servlet.

Configuration

Default Protocol: Servlet 3.0

Container Configuration Options

Name

Type

Default

Description

bindHttpPort

int

9090

The HTTP port the server should bind to.

bindAddress

String

localhost

The host the server should be run on.

jettyPlus

boolean

true

Activates the Jetty plus configuration to support JNDI resources (requires jetty-plus and jetty-naming artifacts on the classpath).

configurationClasses

String

null

Specify your own Jetty configuration classes as a comma separated list.

Example of Maven profile setup

<profile>
	<id>jetty-embedded</id>
	<dependencies>
		<dependency>
			<groupId>org.jboss.arquillian.container</groupId>
			<artifactId>arquillian-jetty-embedded-7</artifactId>
			<version>1.0.0-SNAPSHOT</version>
         <scope>test</scope>
		</dependency>
      <dependency>
         <groupId>org.eclipse.jetty</groupId>
         <artifactId>jetty-webapp</artifactId>
         <version>7.0.2.v20100331</version>
         <scope>test</scope>
      </dependency>
      <!-- plus and naming requires for using JNDI -->
      <dependency>
         <groupId>org.eclipse.jetty</groupId>
         <artifactId>jetty-plus</artifactId>
         <version>7.0.2.v20100331</version>
         <scope>test</scope>
      </dependency>
      <!-- Weld servlet, EL and JSP required for testing CDI injections -->
      <dependency>
         <groupId>org.jboss.weld.servlet</groupId>
         <artifactId>weld-servlet</artifactId>
         <version>1.0.1-Final</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.glassfish.web</groupId>
         <artifactId>el-impl</artifactId>
         <version>2.2</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>javax.servlet.jsp</groupId>
         <artifactId>jsp-api</artifactId>
         <version>2.2</version>
         <scope>test</scope>
      </dependency>
	</dependencies>
</profile>
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-10 12:19:38 UTC, last content change 2011-04-16 16:32:21 UTC.